<?php
/**
 * ExtWebModule the base module all the modules should inherit
 * 
 * @uses CWebModule
 * @version $id$
 * @copyright 2010 &copy; The YAP Group
 * @author Flavius Aspra <flav@yet-another-project.com> 
 * @license License {@link http://yet-another-project.com/project/yap/LICENSE.txt}
 */
class ExtWebModule extends CWebModule {
	public $layout='main';
	protected $features = array();

	public function init() {
		$ev = new ExtEvent($this,FALSE,$this);
		Yii::app()->modulehook->raiseEvent('modules.'.$this->id.'.'.ucfirst($this->id).'Module.init',$ev);
	}
	public function addFeature($ft,$val=TRUE) {
		$this->features[$ft] = $val;
	}
	public function removeFeature($ft) {
		unset($this->features[$ft]);
	}
	public function hasFeature($ft) {
		return array_key_exists($ft,$this->features);
	}
	public function getFeature($ft) {
		return $this->features[$ft];
	}
}
